<template>
	<view class="map-content">
		<map :longitude="mapData.longitude" :latitude="mapData.latitude" :markers="mapData.markers" scale="13"
			@markertap="markertap"></map>
	</view>
</template>

<script>
	import {
		getYouthInternshipListApi
	} from '@/api/map.js'
	export default {
		data() {
			return {
				mapData: {},
			}
		},
		methods: {
			markertap(e) {
				let markerId = e.detail.markerId;

				uni.navigateTo({
					url: '/page_other/company/info'
				})
			}
		},
		onLoad(e) {
			console.log(e)
			var title = e.title ?? '';
			var longitude = e.longitude ?? 0.0;
			var latitude = e.latitude ?? 0.0;
			setTimeout(() => {
				this.mapData = {
					longitude: longitude,
					latitude: latitude,
					markers: [{
						id: 0,
						longitude: longitude,
						latitude: latitude,
						title: title,
						anchor: {
							x: 0.5,
							y: 0.5
						},
						callout: {
							content: title,
							borderRadius: 5,
							display: "ALWAYS",
							padding: 7,
							bgColor: "#FFFFFF"
						}
					}],
					
					}

			}, 1000)
		}
	}
</script>

<style lang="scss">
	.map-content {
		width: 100%;
		height: 100vh;

		map {
			width: 100%;
			height: 100%;
		}
	}
</style>
